<template>
  <footer class="footer">
    <!-- This should be `0 items left` by default -->
    <span class="todo-count">
      <strong>0</strong>
      <span>{{ pieces }}</span>
      item left</span
    >
    <!-- Remove this if you don't implement routing -->
    <ul class="filters" @click="$emit('todoAaaK',inkon)">
      <li>
        <a
          :class="{ selected: inkon === 'all' }"
          @click="inkon = 'all'"
          href="#/"
          >All</a
        >
      </li>
      <li>
        <a
          :class="{ selected: inkon === 'no' }"
          @click="inkon = 'no'"
          href="#/active"
          >Active</a
        >
      </li>
      <li>
        <a
          :class="{ selected: inkon === 'yes' }"
          @click="inkon = 'yes'"
          href="#/completed"
          >Completed</a
        >
      </li>
    </ul>
    <!-- Hidden if no completed items are left ↓ -->
    <button class="clear-completed"
    @click="$emit('clear')">Clear completed</button>
  </footer>
</template>

<script>
export default {
  props: ["arr"],
  computed: {
    pieces() {
      return this.arr.filter((item) => item.isDone === false).length;
    },
  },
  data() {
    return {
      inkon: "all", //yes,no
    };
  },
};
</script>

<style >
</style>